<?php

namespace Keio\StudyBundle\Entity;

use Symfony\Component\Security\Core\User\UserInterface;
use Doctrine\ORM\Mapping as ORM;

/**
 * User
 */
class User implements UserInterface
{
    private $id;

    private $username;

    private $password;

    public function getId()
    {
        return $this->id;
    }

    public function setUsername($username)
    {
        $this->username = $username;
    }

    public function getUsername()
    {
        return $this->username;
    }

    public function setPassword($password)
    {
        $this->password = $password;
    }

    public function getPassword()
    {
        return $this->password;
    }

    private $roles;
    public function setRoles($roles){
    	$this->roles = serialize($roles);
    }

    public function getRoles()
    {
        return unserialize($this->roles);
    }

    public function getSalt()
    {
        return null;
    }

    public function eraseCredentials()
    {

    }

    public function equals(UserInterface $user)
    {
        return $user->getUsername() == $this->getUsername();
    }
    //dành cho form để delete
    private $delform;
    public function setDelform($delform){
    	$this->delform = $delform;
    }
    public function getDelform(){
    	return $this->delform;
    }
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $package_user;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->package_user = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add package_user
     *
     * @param \Keio\StudyBundle\Entity\Packageuser $packageUser
     * @return User
     */
    public function addPackageUser(\Keio\StudyBundle\Entity\Packageuser $packageUser)
    {
        $this->package_user[] = $packageUser;

        return $this;
    }

    /**
     * Remove package_user
     *
     * @param \Keio\StudyBundle\Entity\Packageuser $packageUser
     */
    public function removePackageUser(\Keio\StudyBundle\Entity\Packageuser $packageUser)
    {
        $this->package_user->removeElement($packageUser);
    }

    /**
     * Get package_user
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPackageUser()
    {
        return $this->package_user;
    }
    /**
     * @var string
     */
    private $hoten;

    /**
     * @var string
     */
    private $email;

    /**
     * @var string
     */
    private $dienthoai;


    /**
     * Set hoten
     *
     * @param string $hoten
     * @return User
     */
    public function setHoten($hoten)
    {
        $this->hoten = $hoten;

        return $this;
    }

    /**
     * Get hoten
     *
     * @return string
     */
    public function getHoten()
    {
        return $this->hoten;
    }

    /**
     * Set email
     *
     * @param string $email
     * @return User
     */
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }

    /**
     * Get email
     *
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Set dienthoai
     *
     * @param string $dienthoai
     * @return User
     */
    public function setDienthoai($dienthoai)
    {
        $this->dienthoai = $dienthoai;

        return $this;
    }

    /**
     * Get dienthoai
     *
     * @return string
     */
    public function getDienthoai()
    {
        return $this->dienthoai;
    }
    /**
     * @var integer
     */
    private $dotuoi;


    /**
     * Set dotuoi
     *
     * @param integer $dotuoi
     * @return User
     */
    public function setDotuoi($dotuoi)
    {
        $this->dotuoi = $dotuoi;

        return $this;
    }

    /**
     * Get dotuoi
     *
     * @return integer
     */
    public function getDotuoi()
    {
        return $this->dotuoi;
    }
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $blog;


    /**
     * Add blog
     *
     * @param \Keio\StudyBundle\Entity\Blog $blog
     * @return User
     */
    public function addBlog(\Keio\StudyBundle\Entity\Blog $blog)
    {
        $this->blog[] = $blog;

        return $this;
    }

    /**
     * Remove blog
     *
     * @param \Keio\StudyBundle\Entity\Blog $blog
     */
    public function removeBlog(\Keio\StudyBundle\Entity\Blog $blog)
    {
        $this->blog->removeElement($blog);
    }

    /**
     * Get blog
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBlog()
    {
        return $this->blog;
    }

    public function __toString()
	{
  		return $this->getHoten();
	}
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $baihocketquakiemtra;


    /**
     * Add baihocketquakiemtra
     *
     * @param \Keio\StudyBundle\Entity\Baihocketquakiemtra $baihocketquakiemtra
     * @return User
     */
    public function addBaihocketquakiemtra(\Keio\StudyBundle\Entity\Baihocketquakiemtra $baihocketquakiemtra)
    {
        $this->baihocketquakiemtra[] = $baihocketquakiemtra;
    
        return $this;
    }

    /**
     * Remove baihocketquakiemtra
     *
     * @param \Keio\StudyBundle\Entity\Baihocketquakiemtra $baihocketquakiemtra
     */
    public function removeBaihocketquakiemtra(\Keio\StudyBundle\Entity\Baihocketquakiemtra $baihocketquakiemtra)
    {
        $this->baihocketquakiemtra->removeElement($baihocketquakiemtra);
    }

    /**
     * Get baihocketquakiemtra
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getBaihocketquakiemtra()
    {
        return $this->baihocketquakiemtra;
    }
}